package com.wangdao.mall.model;

import org.omg.CORBA.PRIVATE_MEMBER;

/**
 * @Author:HaiyangTian
 * @Description:
 * @Date: Created in 19:35 2020/5/3
 * @Modified By:
 */
public class Order {

    private Integer id;

    private Integer userId;

    private Integer goodsDetailId;

    private String goods;

    private String spec;

    private Integer goodsNum;

    private Double amount;

    private Integer stateId;

    private String state;

    private String nickname;

    private String name;

    private String address;

    private String phone;

    private OrderUser user;

    private String createtime;

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public Integer getUserId() {
        return userId;
    }

    public void setUserId(Integer userId) {
        this.userId = userId;
    }

    public Integer getGoodsDetailId() {
        return goodsDetailId;
    }

    public void setGoodsDetailId(Integer goodsDetailId) {
        this.goodsDetailId = goodsDetailId;
    }

    public String getGoods() {
        return goods;
    }

    public void setGoods(String goods) {
        this.goods = goods;
    }

    public String getSpec() {
        return spec;
    }

    public void setSpec(String spec) {
        this.spec = spec;
    }

    public Integer getGoodsNum() {
        return goodsNum;
    }

    public void setGoodsNum(Integer goodsNum) {
        this.goodsNum = goodsNum;
    }

    public Double getAmount() {
        return amount;
    }

    public void setAmount(Double amount) {
        this.amount = amount;
    }

    public Integer getStateId() {
        return stateId;
    }

    //dbutils通过反射封装数据到order里会调用这个方法
    public void setStateId(Integer stateId) {
        if (stateId == 0){
            setState("未付款");
        }else if (stateId == 1){
            setState("未发货");
        }else if (stateId == 2){
            setState("已发货");
        }else if (stateId == 3){
            setState("已到货");
        }
        this.stateId = stateId;
    }

    public String getState() {
        return state;
    }

    public void setState(String state) {
        this.state = state;
    }

    public String getNickname() {
        return nickname;
    }

    public void setNickname(String nickname) {
        this.nickname = nickname;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getAddress() {
        return address;
    }

    public void setAddress(String address) {
        this.address = address;
    }

    public String getPhone() {
        return phone;
    }

    public void setPhone(String phone) {
        this.phone = phone;
    }

    public OrderUser getUser() {
        return user;
    }

    public void setUser(OrderUser user) {
        this.user = user;
    }

    public String getCreatetime() {
        return createtime;
    }

    public void setCreatetime(String createtime) {
        this.createtime = createtime;
    }

    @Override
    public String toString() {
        return "Order{" +
                "id=" + id +
                ", userId=" + userId +
                ", goodsDetailId=" + goodsDetailId +
                ", goods='" + goods + '\'' +
                ", spec='" + spec + '\'' +
                ", goodsNum=" + goodsNum +
                ", amount=" + amount +
                ", stateId=" + stateId +
                ", state='" + state + '\'' +
                ", nickname='" + nickname + '\'' +
                ", name='" + name + '\'' +
                ", address='" + address + '\'' +
                ", phone='" + phone + '\'' +
                ", user=" + user +
                ", createtime='" + createtime + '\'' +
                '}';
    }
}
